package com.intelligent.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.intelligent.service.PaymentWriteOffService;
import com.intelligent.vo.PaymentWriteOffCreateReq;
import com.intelligent.vo.PaymentWriteOffPageReq;
import com.intelligent.vo.PaymentWriteOffResp;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/payment-write-off")
public class PaymentWriteOffController {

    @Resource
    private PaymentWriteOffService paymentWriteOffService;

    @PostMapping("/page")
    public Page<PaymentWriteOffResp> page(@RequestBody PaymentWriteOffPageReq req) {
        return paymentWriteOffService.page(req);
    }

    @GetMapping("/{id}")
    public PaymentWriteOffResp detail(@PathVariable Long id) {
        return paymentWriteOffService.detail(id);
    }

    @PostMapping("/create")
    public PaymentWriteOffResp create(@RequestBody PaymentWriteOffCreateReq req) {
        return paymentWriteOffService.create(req);
    }
}


